package ai.people.netmon.framework.exception.enums;

/**
 * 图异常枚举
 *
 * @author zhenglin
 * @date 2022/4/12
 */
public enum GraphExceptionEnum implements ExceptionEnum{

    /**
     * 图中有孤立点
     */
    OUTLIER(false, 800000, "图中有孤立点"),
    PATH_NOT_MAPPING_NODE(false, 800001, "路径和节点不匹配"),
    NODE_NOTFOUND(false, 800002, "节点找不到"),
    TAG_NOT_MAPPING(false, 800003, "标签不存在"),
    FIELD_NOT_EMPTY(false, 800004, "值不能为空"),
    TAG_NOT_SUPPORT(false, 800005, "该标签类型不支持"),
    /**
     * 标签不存在
     */
    TAG_NOT_EXISTS(false, 800006, "标签不存在"),
    /**
     * 边不存在
     */
    EDGE_NOT_EXISTS(false, 800007, "边不存在"),
    SAVE_GRAPH_ERR(false, 800008, "保存图失败"),
    OPT_ERR(false, 800009, "操作图失败"),
    ;

    /**
     * 状态
     */
    final boolean status;
    /**
     * 代码
     */
    final int code;
    /**
     * 消息
     */
    final String message;

    GraphExceptionEnum(boolean status, int code, String message) {
        this.status = status;
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }

    @Override
    public boolean getStatus() {
        return this.status;
    }
}
